import 'package:json_annotation/json_annotation.dart';
import 'package:gzmall_app/model/coupon.dart';
import 'package:gzmall_app/model/confirm_order_item.dart';

part 'confirm_order.g.dart';

@JsonSerializable()
class ConfirmOrder extends Object {
  @JsonKey(name: 'shop_id')
  int shopId;

  @JsonKey(name: 'shop_avatar')
  String shopAvatar;

  @JsonKey(name: 'shop_name')
  String shopName;

  @JsonKey(name: 'order_items')
  List<ConfirmOrderItem> orderItems;

  @JsonKey(name: 'coupons')
  List<Coupon> coupons;

  @JsonKey(name: 'total_fee')
  String totalFee;

  @JsonKey(name: 'total_quantity')
  int totalQuantity;

  @JsonKey(name: 'express_fee')
  String expressFee;

  @JsonKey(name: 'coupon_fee')
  String couponFee;

  ConfirmOrder(
    this.shopId,
    this.shopAvatar,
    this.shopName,
    this.orderItems,
    this.coupons,
    this.totalFee,
    this.totalQuantity,
    this.expressFee,
    this.couponFee,
  );

  factory ConfirmOrder.fromJson(Map<String, dynamic> srcJson) =>
      _$ConfirmOrderFromJson(srcJson);
}
